﻿<link href="<?php echo base_url()?>common/css/public.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="<?php echo base_url()?>common/kindeditor/themes/default/default.css" />
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/layer/layer.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.form.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.validate.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.metadata.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.validate.messages_cn.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/validate.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/validateForm.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.Msg.js"></script>
<script type="text/javascript">

    function Success(data) {
        parent.Success(data);

    }
    $(function () {
        $(".tableBasic form").each(function () {
            var itemsId = $(this).attr('id');
            $.validate_inventory(itemsId);
        });
    });
</script>
<div id="dcMain" style="margin-left:0;padding-top:10px;">
    <!-- 当前位置 -->
    <div id="manager" class="mainBox" style="padding-top:0;">
        <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
            <tr>
                <th>尺码————》颜色</th>
                <th>库存量</th>
            </tr>
            <?php foreach($goodssizelist as $goodssizeItem):?>
            <?php foreach($goodscolorlist as $goodscolorItem):?>
            <tr>
                <td width="400" align="left"><?php echo $goodssizeItem['title']?>——》<?php echo $goodscolorItem['title']?>
                    <span style="float:right;display:block;height:20px;width:20px;background-color:#<?php echo $goodscolorItem['colorkey'];?>;"></span>
                </td>
                <td><form id="ajax_form_<?php echo $goodssizeItem['size_id']?>_<?php echo $goodscolorItem['color_id']?>" method="post" action="<?php echo site_url('admin/goods/edit_inventory')?>">
                    <input type="hidden" name="goods_id" value="<?php echo $goodssizeItem['goods_id']?>"/>
                    <input type="hidden" name="size_id" value="<?php echo $goodssizeItem['size_id']?>" />
                    <input type="hidden" name="color_id" value="<?php echo $goodscolorItem['color_id']?>" />
                    <input style="height:24px;" id="inventory_<?php echo $goodssizeItem['size_id']?>_<?php echo $goodscolorItem['color_id']?>" name="inventory_count" type="text" value="<?php $this->load->controller->get_inventory($goodssizeItem['goods_id'],$goodscolorItem['color_id'],$goodssizeItem['size_id']);?>" />
                    <input style="padding:4px 10px;" type="submit" value="修改" /></form> </td>
            </tr>
            <?php endforeach;?>
            <?php endforeach;?>
        </table>
    </div>
    <?php 
   //$this->one();
        //one();
    $this->load->controller->get_inventory(20,1,1);
    ?>
</div>